package main
import (
	"fmt"
	"time"
)
func main() {
	str := "2024-04-01 22:35:30"
	// 把字符串转换成时间戳
	t, err := time.Parse("2006-01-02 15:04:05", str)
	if err != nil {
		fmt.Println("time.Parse err = ", err)
	}
	fmt.Println(t)
	fmt.Println("秒：  ", t.Unix())
	fmt.Println("毫秒：", t.UnixMilli())
	fmt.Println("微秒：", t.UnixMicro())
	fmt.Println("纳秒：", t.UnixNano())
	
}